import Vue from 'vue'
import Router from 'vue-router'
import Test from '@/components/Test'
import Login from '@/components/Login'
import Home from '@/components/Home'
import Reg from '@/components/Reg'
import Category from '@/components/Category.vue'
import Cart from '@/components/Cart.vue'
import Mine from '@/components/Mine.vue'
import GoodsDetail from '@/components/GoodsDetail.vue'
import AddressManage from '@/components/AddressManage.vue'
import AddressManageAdd from '@/components/AddressManageAdd.vue'
import AddressManageEdit from '@/components/AddressManageEdit.vue'
import Orders from '@/components/Orders.vue'
import Settle from '@/components/Settle.vue'
import PersonalInfo from '@/components/PersonalInfo.vue'
import Checkstand from '@/components/Checkstand.vue'
import MyWallet from '@/components/MyWallet.vue'
import SearchPage from '@/components/SearchPage.vue'
import ModifyPassword from '@/components/ModifyPassword.vue'
Vue.use(Router)

export default new Router({
	mode: 'history',
	routes: [{
			path: '/test',
			name: 'Test',
			component: Test
		},
		{
			path: '/login',
			name: 'Login',
			component: Login
		},
		{
			path: '/home',
			name: 'Home',
			component: Home
		},
		{
			path: '*',
			redirect: '/home'
		},
		{
			path: '/',
			redirect: '/home'
		},
		{
			path: '/register',
			name: 'Reg',
			component: Reg
		},
		{
			path: '/category',
			name: 'Category',
			component: Category
		},
		{
			path: '/category/:id',
			name: 'Category',
			component: Category
		},
		{
			path: '/cart',
			name: 'Cart',
			component: Cart
		},
		{
			path: '/mine',
			name: 'Mine',
			component: Mine
		},
		{
			path: '/detail',
			name: 'Detail',
			component: GoodsDetail
		},
		{
			path: '/detail/:id',
			name: 'Detail',
			component: GoodsDetail
		},
		{
			path: '/address',
			name: 'AddressManage',
			component: AddressManage
		},
		{
			path: '/addressAdd',
			name: 'AddressManageAdd',
			component: AddressManageAdd
		},
		{
			path: '/addressEdit',
			name: 'AddressManageEdit',
			component: AddressManageEdit
		},
		{
			path: '/orders',
			name: 'Orders',
			component: Orders
		},
		{
			path: '/settle',
			name: 'Settle',
			component: Settle
		},
		{
			path: '/personalInfo',
			name: 'PersonalInfo',
			component: PersonalInfo
		},
		{
			path: '/checkstand',
			name: 'Checkstand',
			component: Checkstand
		},
		{
			path: '/myWallet',
			name: 'MyWallet',
			component: MyWallet
		},
		{
			path: '/searchPage',
			name: 'SearchPage',
			component: SearchPage
		},
		{
			path: '/modifyPassword',
			name: 'ModifyPassword',
			component: ModifyPassword
		},
	]
})